<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="${initParam.url }/statics/css/detail.css" rel="stylesheet">
<link href="${initParam.url }/statics/css/compilewrite.css" rel="stylesheet">
<script src="${initParam.url}/statics/js/jquery-1.12.4.js"></script>
	<script>
	$(document).ready(function() {

		$("#serviceArea").blur(checkpassword);
		$("#phone").blur(checkPass);
		$("#name").blur(checkUsername);

		$("#jo").click(function() {
			var flag = true;
			
			if (!checkpassword()) {
			
				flag = false;
			}
			if (!checkPass()) {
			
				flag = false;
			}
			if (!checkUsername()) {
			
				flag = false;
			}
			
       
			return 	flag;
			
		})
	})
	//验证密码
	function checkPass() {
		var $pwd = $("#phone");
		var $divID = $("#Divphone");
		$divID.html("");
		if ($pwd.val() == "") {
			$divID.html("请输入手机号码");
			return false;
		}
		else if ($pwd.val().length != 11) {
			$divID.html("请输入正确的手机号码");
			return false;
		}	
	
		return true;
	}

	function checkpassword() {
		var $pwd = $("#serviceArea");
		var $divID = $("#DivserviceArea");
		$divID.html("");
		if ($pwd.val() == "") {
			$divID.html("请输入服务范围");
			return false;
		}
		return true;
	}
	//验证名字
	function checkUsername() {
		var $fname = $("#name");
		var $divID = $("#DivUsername");
		$divID.html("");
		if ($fname.val() == "") {
			$divID.html("请输入家政名称");
			return false;
		}
		return true;
	}
</script>
</head>

<body>
	<div style="width: 1090px;height: 540px;background-color: #FFF;margin: 20px;">
		<h4
			style="background-color: #9FB2C2; padding-left: 10px; color: #516D8A; line-height: 40px;">
			<img alt="" src="${initParam.url}/statics/images/title.jpg">
			添加家政
		</h4>
		
		<div class="sp">
					<form action="dohomemakeadd" method="post"  id="btn">				
							<table>
								<tr>
									<td class="tr-1">家政名称:</td>
									<td><input class="tr-2" style="width: 220px;height: 25px;" name="name" id="name" type="text" value="" />&nbsp;<span
							id='DivUsername'></span></td>

								<tr>
									<td class="tr-1">联系电话:</td>
									<td><input class="tr-2" style="width: 220px;height: 25px;" name="phone" id="phone" type="text" />&nbsp;<span
							id='Divphone'></span></td>
								</tr>
								<tr>
									<td class="tr-1">服务范围:</td>
									<td><input class="tr-2" style="width: 220px;height: 25px;" name="serviceArea" id="serviceArea" type="text" />&nbsp;<span
							id='DivserviceArea'></span></td>
								</tr>
								<tr>
									<td colspan="2" class="td-1">
									<input type="submit"  class="btn btn-default" value="确定" id="jo"> <input type="button" class="btn btn-default" onclick="history.go(-1)" value="取消"></td>
								</tr>
							</table>

						</form>
			
		</div>
	</div>
</body>
</html>